package com.jjc.MyWebApp.Model.AjaxModel;

/**
 * Created by jiaji on 2017/5/10.
 */
public class JsonModel {

    public int code = 0 ; //0表示成功，其它表示失败
    public String msg = ""; //提示信息
    public Object data =null; //其它数据


    public JsonModel(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }


    public static JsonModel successMsg(String Msg){
        return new JsonModel(0,Msg,null);
    }
    public static JsonModel successMsg(String Msg,Object data){
        return new JsonModel(0,Msg,data);
    }
    public static JsonModel errorMsg(String Msg){
        return new JsonModel(1,Msg,null);
    }
    public static JsonModel errorMsg(String Msg,Object data){
        return new JsonModel(1,Msg,data);
    }
}
